#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main() {
    int n = 0;
    int a, b, c;
    int sum = 0;
    int count = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        while (scanf("%d %d %d", &a, &b, &c) != EOF)
        {
            sum = a + b + c;
            if (sum / 3 < 60)
            {
                count++;
            }
        }
    }
    printf("%d", count);
    return 0;
}